<!--
    关于使用innerHTML
-->
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <table border=1px>
        <tr>
            <td>numa大于numb的分数吗？</td>
            <td>numa不等于numb的分数吗？</td>
        </tr>
        <tr>
            <td><input type="button" value="判断" id="s01"></input></td>
            <td><input type="button" value="判断" id="s02"></input></td>
        </tr>
        <tr>
        	<td><p id="w01">待判断</p></td>
          <td><p id="w02"></p></td>
        </tr>
    </table>
    <script type="text/javascript">
        //
        var numa,numb,jq1,jq2;
        numa=1;
        numb=7;
        jq1=(numa<numb);
        jq2=(numa!=numb);
        //
        document.getElementById("s01").onclick=function(){        
	        if(jq1){
                document.getElementById("w01").innerHTML = "<strong style='color:red;'>Yes!</strong>"+"&nbsp;且numa-numb= "+(numa-numb);
   		        //下面亦可
                /*var changeContent = document.getElementById("w01");
                changeContent.innerHTML = "<strong>ni</strong>";*/
            } 
            else{
                document.getElementById("w01").innerHTML = "<strong style='color:red;'>NO!</strong>"+"&nbsp;且numa-numb= "+(numa-numb);
            }
        }
        document.getElementById("s02").onclick=function(){        
	        if(jq2){
                document.getElementById("w02").innerHTML = "<strong style='color:red;'>Yes!</strong>"+"&nbsp;且numa-numb= "+(numa-numb);
            } 
            else{
                document.getElementById("w02").innerHTML = "<strong style='color:red;'>Equal!</strong>";
            }
        }
    </script>
</body>
</html>
